You are here: Trading System Programming > Reference > Classes > Application > Application Methods > getCurrentTime

getCurrentTime

The getCurrentTime method returns an instance of the Date object representing current application's time.

Syntax

var getCurrentTime();

Return Value

The method returns a valid Date object instance set to Eastern Standard Time.

Example

The following example demonstrates the use of getCurrentTime() method.

 

function start()

{

//retrieve account's executions orders

var account = getAccount();

var executions = account.getExecutions();

 

//loop through all executions

for(var i = 0; i < executions.length, i++)

{

var execution = executions[i];

 

//check to see how many days ago this execution happened

var difference = Application.getCurrentTime() - execution.getDateTime();

 

//since difference is in milliseconds, convert to days

difference = Math.round(difference / 1000 / 60 / 60 / 24);

}

 

//proceed further...

}

 


Copyright © 2006-2009 ActiveTick LLC